package com.example.demo.service.impl;

import com.example.demo.dao.RoominfoDao;
import com.example.demo.entity.Room_Picture;
import com.example.demo.entity.Roominfo;
import com.example.demo.service.RoominfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoominfoServiceImpl implements RoominfoService {
    @Resource
    RoominfoDao roominfoDao;
    @Override
    public int insertroominfo(Roominfo roominfo) {
        return roominfoDao.insertroominfo(roominfo);
    }

    @Override
    public List<Roominfo> roominfolist() {
        return roominfoDao.roominfolist();
    }

    @Override
    public Roominfo selectroominfo(int no) {
        return roominfoDao.selectroominfo(no);
    }

    @Override
    public int updateroominfo(Roominfo roominfo) {
        System.out.println(roominfo);
        roominfoDao.updateroominfo(roominfo);
        return 1;
    }

    @Override
    public int deleteroominfo(int no) {
        roominfoDao.deleteroominfo(no);
        return 1;
    }

    @Override
    public List<Roominfo> selectroomlist(int floor_id) {
        return roominfoDao.selectroomlist(floor_id);
    }

    @Override
    public List<Room_Picture> selectRoom_Pictures(int no,int floor_id) {
        return roominfoDao.selectRoom_Pictures(no,floor_id);
    }

    @Override
    public Roominfo selectroompicturebyid(int no, int floor_id) {
        return roominfoDao.selectroompicturebyid(no,floor_id);
    }
}
